package com.miniapp.service.impl;

import com.miniapp.entity.MiniUserEntity;
import com.miniapp.entity.MiniUserTokenEntity;
import com.miniapp.mapper.MiniUserMapper;
import com.miniapp.service.MiniUserTokenService;
import com.miniapp.service.ShiroService;
import jdk.nashorn.internal.ir.annotations.Reference;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

@Service
public class ShiroServiceImpl implements ShiroService {
    @Reference
    private MiniUserMapper miniUserMapper;
    @Autowired
    private MiniUserTokenService miniUserTokenService;

    @Override
    public MiniUserTokenEntity queryByToken(String token) {
        return miniUserTokenService.queryByToken(token);
    }

    @Override

    public MiniUserEntity queryUser(Long userId) {
        return miniUserMapper.selectById(userId);
    }
}
